K8SPG-1019 Apply Go 1.26 code improvements using go fix#1585
Conversation
|
|
||
| "github.com/percona/percona-postgresql-operator/v2/internal/controller/runtime" | ||
| "github.com/percona/percona-postgresql-operator/v2/internal/initialize" | ||
|
|
There was a problem hiding this comment.
[goimports-reviser] reported by reviewdog 🐶
|
|
||
| "github.com/percona/percona-postgresql-operator/v2/internal/feature" | ||
| "github.com/percona/percona-postgresql-operator/v2/internal/initialize" | ||
|
|
There was a problem hiding this comment.
[goimports-reviser] reported by reviewdog 🐶
| "github.com/percona/percona-postgresql-operator/v2/internal/config" | ||
| "github.com/percona/percona-postgresql-operator/v2/internal/feature" | ||
| "github.com/percona/percona-postgresql-operator/v2/internal/initialize" | ||
|
|
There was a problem hiding this comment.
[goimports-reviser] reported by reviewdog 🐶
|
|
||
| // Bool returns a pointer to v. | ||
| func Bool(v bool) *bool { return &v } | ||
| // |
There was a problem hiding this comment.
Do we still need this package? I saw that almost all usage of initialize was replaced with new
There was a problem hiding this comment.
we still use the package for other functions here and there, better not to do anything with it under this pr
There was a problem hiding this comment.
Removed some functions from the package that are not used and fixed some unit tests that, after the go fix didn't do anything meaningful.
commit: f606450 |
https://perconadev.atlassian.net/browse/K8SPG-1019
CHANGE DESCRIPTION
Problem:
Go 1.26 revamped go fix with 22 new analyzers that automatically modernize code to use current Go idioms. We should run these across the codebase and apply the suggested changes.
Similar PR: percona/percona-xtradb-cluster-operator#2460
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability